package org.kzwl.service.web.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.kzwl.comm.pojo.bo.interaction.InteractionAddBO;
import org.kzwl.comm.pojo.bo.interaction.InteractionBasicBO;
import org.kzwl.comm.pojo.dto.interaction.InteractionBasicDTO;
import org.kzwl.entity.app.CuVolunteersUser;
import org.kzwl.entity.web.CuInteraction;
import org.kzwl.mapper.web.CuInteractionMapper;
import org.kzwl.mapper.web.CuVolunteersUserMapper;
import org.kzwl.service.web.CuInteractionService;
import org.kzwl.service.web.CuVolunteersUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CuInteractionServiceImpl extends ServiceImpl<CuInteractionMapper, CuInteraction> implements CuInteractionService {

    @Autowired
    private CuInteractionMapper interactionMapper;

    //region Web基础查询
    @Override
    public IPage<InteractionBasicDTO> queryBasic(InteractionBasicBO bo) {
        IPage<InteractionBasicDTO> page = new Page<>();
        page.setCurrent(bo.getCurrent()).setSize(bo.getSize());
        page = interactionMapper.queryBasic(page, bo);
        return page;
    }
    //endregion

    //region 添加互动空间
    @Override
    public void insertInteraction(InteractionAddBO bo) {
        CuInteraction interaction = new CuInteraction();
        BeanUtils.copyProperties(bo,interaction);
        interactionMapper.insert(interaction);
    }
    //endregion

}
